<?php session_start();
$_SESSION["id_Exp"] = 0;
 ?>
<html><head>
<?php 
echo "haha" . $_POST['title'] . "</br>";
$con= mysql_connect("localhost","root","");

echo "<script>alert ('".$_POST['exper']."');</script>";
if(!$con){
die('Connection Error!:' . mysql_error());
}
mysql_select_db ("usabilityevaluation",$con);



$exp_name=$_POST['exper'];
$name=$_POST['title'];
$time=$_POST['time'];
$query1="INSERT INTO experimentation (Title,Date) VALUES ('$name ','$time')";
mysql_query($query1) or die('Error, insert query failed');

 $result = mysql_query("SELECT Max(id_exp) FROM experimentation") or die('Error, insert query failed');
 while($row = mysql_fetch_array($result))
  { 
  $_SESSION["id_Exp"]=$row[0]; 
  }
if($_POST['newExp'] == 'submit') {
$_SESSION['name_exp']=null;
header("Location: SetUp.php"); 
}
else {
$result = mysql_query("SELECT id_exp FROM experimentation WHERE Title='$exp_name'") or die('Error, insert query failed');
 while($row = mysql_fetch_array($result))
  { $_SESSION['Old_id']=row; }
//$_SESSION['name_exp']=$row[0];


header("Location:expLoad.php"); 
}
 mysql_close($con);
?>
</head><body></body></html>
